﻿namespace SuperSimpleTcp.UnitTest
{
    using System.IO;

    public static class TestCertificateHelper
    {
        public static void CreateCertificate(string certificateFilePath)
        {
            var certificateData = @"-----BEGIN CERTIFICATE-----
MIIFqTCCA5GgAwIBAgIUALJzgmmtlYlKi/7qIP3KlaC3YN0wDQYJKoZIhvcNAQEL
BQAwYzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFzAVBgNVBAcM
DlNpbGljb24gVmFsbGV5MRIwEAYDVQQKDAlTaW1wbGVUY3AxEjAQBgNVBAMMCXNp
bXBsZXRjcDAgFw0xODExMjkxODA2MTVaGA8yMTE4MTEwNTE4MDYxNVowYzELMAkG
A1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFzAVBgNVBAcMDlNpbGljb24g
VmFsbGV5MRIwEAYDVQQKDAlTaW1wbGVUY3AxEjAQBgNVBAMMCXNpbXBsZXRjcDCC
AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMn8DVfN1MVCq/BfOLgTosY7
jSBFU7W2//0ha0BsWrciGL9rQ80Pvpfno1twpUX3OIs0jniooKDAUNKeHJvj2fle
5lACDOOgaYslXfpiKIOskTcqj4zpOdjhgo4Itpa+KnMaEq0DXj0y45WI2Z4E4Ruj
IZkVMNSsfF3OVa8ZT2R/SurFlNsy5IWqWSeodP9YBV91Lc+7AZ/GbYKy1Qu/5mS6
++z7ZA8lCr4Nn2wnnoQqdZMU28zeHCTCT/ywlse4T5LTTwDfs4P/YuN4It1lxmSm
qjo4yqpxoOdlXn4CKxRMaDpz29AspU0/g7bRn5keEnPqymYQ/i03FgHbDG9mJizM
0uw4EnvuWGoilCRz1CkvpKnpZ/Tq8FTy1JIqC7wKIYa4lRLXdhPvs7L4a3jSpWTj
CiXeXKc4hRrAjTNw+OyaviPJW2Bc+lZTDO24SxweGnVIJ6fdeV0SZAPKgynpXKT5
KJvSsxmsCGfh937tasD5wnu6DB9gUQLvIYpDKCc8lZTYv55Exv5JEKZ/Gn8FJU5D
WTlvW1UVQdYdYeppNv5KvAvSOLr08GtzxKOY2Y+k8PI1eUmBYkuo+0r1SORCvj3U
Dcd3njjcFOTv2Agb4Ohbh9FY96yukQ3yxwIQT6ad6LZahr6HeKHKiP5DQ/2xDBJp
I/olGBB59cRVRFgt+7zTAgMBAAGjUzBRMB0GA1UdDgQWBBSpz8QPxENL4/qbHYTV
5u2uYf8p4TAfBgNVHSMEGDAWgBSpz8QPxENL4/qbHYTV5u2uYf8p4TAPBgNVHRMB
Af8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4ICAQCU5B0o9+Vimk7bbgklFSbX2L2/
ml+oVTIvyi0mQThnXr348ddv0zROVhQnPQUcdnlGdCPiYl+Jpkyr14bnOunvjjhQ
wOer3r+mF4aU/kW618uXhHIsIkiKwCBwXGfOCqd/Phnptknjf6teq/R8OgGBMUY0
twqWT4y7epyA0dFm+4bQzOu1FGHIvgfpv6Hjb0+jWPId8TP2bvgU674w6fm0KKDe
7ubYVi/Q9i494WbFY5PGY2MBu82gcMSIuVasVLJAaaj6vxsrK31dYkRGWGm6YOjB
38g4TanmiK0AjVkxhhMuiOJYMFe8R2dOHJBTd6wnnnPKa+IgUk9RJEdPLXV4Pkqh
2QdI9APAjxlJ5RMZfLa1ADPOP+NBENkIo43W7Cmx+z2BLU4/9OB0doHk7MBiTKFO
V58ZkJOrApY9uFvSdJELWcfQlzn0XDAP12lEnJoLEorQK3mi4peXPWZRs1Iw5dAE
pFz89Qy7Bc3i8MRkMWdu1eD17iiXSAd9G12wHlgaoR4GT2vDG870ce8/aefWInmj
xs2RQTlx9g7DGi4WmMozUJh1ENrgI+ppL7yJiVUCsbDejOHAh1qurvZbgIA7qiHm
SZMu7dm8BPlVhLtdkhR+9pdFWm+TjEhuIsyc6sxP5SqwI4xhGxSsMDQ2DkD+laYP
shLs1ionTO/MVOisLA==
-----END CERTIFICATE-----
";

            File.WriteAllText(certificateFilePath, certificateData);
        }
    }
}
